#include "Task.hpp"
#include "ThreadPool.hpp"
#include <cstdlib>
#include<iostream>
#include<unistd.h>

int main()
{
    srand((unsigned long)time(nullptr)^0x22654);
    ThreadPool<Task>* tp=ThreadPool<Task>::getThreadPool();
    //ThreadPool<Task>::getThreadPool()->run();
    tp->run();
    while(true){
        int x=rand()%100+1;
        int y=rand()%20+1;
        Task task(x,y,[](int x,int y)->int{
            return x+y;
        });
        ThreadPool<Task>::getThreadPool()->pushTask(task);
        sleep(1);
    }
    return 0;
}